package com.nana.framework.net
{
	import flash.events.Event;
	
	public class DataEvent extends Event
	{
		
		public static const ERROR_DATA:String = "error_data";
		
		private var _data:Object;
		private var _key:String;
		
		public function DataEvent(type:String, data:Object, key:String){
			super(type, false, false);
			this._data = data;
			this._key = key;
		}
		
		public function getNewDataEvent(type:String=null):DataEvent{
			if (type == null) {
				type = this.type;
			}
			return new DataEvent(type, this.data, this.key);
		}

		public function get data():Object
		{
			return _data;
		}

		public function set data(value:Object):void
		{
			_data = value;
		}

		public function get key():String
		{
			return _key;
		}

		public function set key(value:String):void
		{
			_key = value;
		}


	}
}